import { myAjax } from '@/utils/ajax'

/**
 * 获取角色列表数据
 */
export function getRoleList (data, options = {}) {
  return myAjax({
    method: 'post',
    url: '/system/role/get_role_list',
    data: data,
    ...options
  })
}

/**
 * 获取账户资源
 */
export function getRoleResource (roleId) {
  return myAjax({
    url: '/system/role/get_resources_for_role',
    data: {
      froleId: roleId
    }
  })
}

/**
 * 删除角色
 */
export function delRole (roleId) {
  return myAjax({
    url: '/system/role/delete_role',
    data: {
      froleId: roleId
    }
  })
}

/**
 * 保存账户信息
 */
export function saveRoleInfo (data) {
  return myAjax({
    method: 'post',
    url: '/system/role/save_role',
    data: data
  })
}
